import { VxeModalPropTypes, getConfig } from 'vxe-pc-ui';
import { VxeModalEvents } from 'vxe-pc-ui/types/components/modal';
import { noop } from 'lodash-es';

export const BasicProps = {
  modelValue: Boolean as PropType<VxeModalPropTypes.ModelValue>,
  id: String as PropType<VxeModalPropTypes.ID>,
  type: {
    type: String as PropType<VxeModalPropTypes.Type>,
    default: 'modal',
  },
  loading: {
    type: Boolean as PropType<VxeModalPropTypes.Loading>,
    default: null,
  },
  status: String as PropType<VxeModalPropTypes.Status>,
  iconStatus: String as PropType<VxeModalPropTypes.IconStatus>,
  className: String as PropType<VxeModalPropTypes.ClassName>,
  top: {
    type: [Number, String] as PropType<VxeModalPropTypes.Top>,
    default: () => getConfig().modal.top,
  },
  position: [String, Object] as PropType<VxeModalPropTypes.Position>,
  title: String as PropType<VxeModalPropTypes.Title>,
  duration: {
    type: [Number, String] as PropType<VxeModalPropTypes.Duration>,
    default: () => getConfig().modal.duration,
  },
  content: [Number, String] as PropType<VxeModalPropTypes.Content>,
  showCancelButton: {
    type: Boolean as PropType<VxeModalPropTypes.ShowCancelButton>,
    default: true,
  },
  cancelButtonText: {
    type: String as PropType<VxeModalPropTypes.CancelButtonText>,
    default: () => getConfig().modal.cancelButtonText,
  },
  showConfirmButton: {
    type: Boolean as PropType<VxeModalPropTypes.ShowConfirmButton>,
    default: () => true,
  },
  confirmButtonText: {
    type: String as PropType<VxeModalPropTypes.ConfirmButtonText>,
    default: () => getConfig().modal.confirmButtonText,
  },
  lockView: {
    type: Boolean as PropType<VxeModalPropTypes.LockView>,
    default: () => getConfig().modal.lockView,
  },
  lockScroll: Boolean as PropType<VxeModalPropTypes.LockScroll>,
  mask: {
    type: Boolean as PropType<VxeModalPropTypes.Mask>,
    default: () => getConfig().modal.mask,
  },
  maskClosable: {
    type: Boolean as PropType<VxeModalPropTypes.MaskClosable>,
    default: () => getConfig().modal.maskClosable,
  },
  escClosable: {
    type: Boolean as PropType<VxeModalPropTypes.EscClosable>,
    default: () => getConfig().modal.escClosable,
  },
  cancelClosable: {
    type: Boolean as PropType<VxeModalPropTypes.CancelClosable>,
    default: () => getConfig().modal.cancelClosable,
  },
  confirmClosable: {
    type: Boolean as PropType<VxeModalPropTypes.ConfirmClosable>,
    default: () => getConfig().modal.confirmClosable,
  },
  resize: Boolean as PropType<VxeModalPropTypes.Resize>,
  showHeader: {
    type: Boolean as PropType<VxeModalPropTypes.ShowHeader>,
    // default: () => getConfig().modal.showHeader,
    default: true,
  },
  showFooter: {
    type: Boolean as PropType<VxeModalPropTypes.ShowFooter>,
    // default: () => getConfig().modal.showFooter,
    default: true,
  },
  showZoom: Boolean as PropType<VxeModalPropTypes.ShowZoom>,
  zoomConfig: Object as PropType<VxeModalPropTypes.ZoomConfig>,
  showMaximize: {
    type: Boolean as PropType<VxeModalPropTypes.ShowMaximize>,
    // default: () => handleBooleanDefaultValue(getConfig().modal.showMaximize),
    default: false,
  },
  showMinimize: {
    type: Boolean as PropType<VxeModalPropTypes.ShowMinimize>,
    // default: () => handleBooleanDefaultValue(getConfig().modal.showMinimize),
    default: false,
  },
  showClose: {
    type: Boolean as PropType<VxeModalPropTypes.ShowClose>,
    default: () => getConfig().modal.showClose,
  },
  dblclickZoom: {
    type: Boolean as PropType<VxeModalPropTypes.DblclickZoom>,
    default: () => getConfig().modal.dblclickZoom,
  },
  width: {
    type: [Number, String] as PropType<VxeModalPropTypes.Width>,
    default: () => getConfig().modal.width ?? 800,
  },
  height: {
    type: [Number, String] as PropType<VxeModalPropTypes.Height>,
    default: () => getConfig().modal.height,
  },
  minWidth: {
    type: [Number, String] as PropType<VxeModalPropTypes.MinWidth>,
    default: () => getConfig().modal.minWidth,
  },
  minHeight: {
    type: [Number, String] as PropType<VxeModalPropTypes.MinHeight>,
    default: () => getConfig().modal.minHeight,
  },
  zIndex: Number as PropType<VxeModalPropTypes.ZIndex>,
  marginSize: {
    type: [Number, String] as PropType<VxeModalPropTypes.MarginSize>,
    default: () => getConfig().modal.marginSize,
  },
  fullscreen: Boolean as PropType<VxeModalPropTypes.Fullscreen>,
  draggable: {
    type: Boolean as PropType<VxeModalPropTypes.Draggable>,
    // default: () => getConfig().modal.draggable,
    default: false,
  },
  remember: { type: Boolean, default: () => getConfig().modal.remember },
  destroyOnClose: {
    type: Boolean as PropType<VxeModalPropTypes.DestroyOnClose>,
    default: () => getConfig().modal.destroyOnClose,
  },
  showTitleOverflow: {
    type: Boolean as PropType<VxeModalPropTypes.ShowTitleOverflow>,
    default: () => getConfig().modal.showTitleOverflow,
  },
  transfer: {
    type: Boolean as PropType<VxeModalPropTypes.Transfer>,
    default: () => getConfig().modal.transfer,
  },
  storage: {
    type: Boolean as PropType<VxeModalPropTypes.Storage>,
    default: () => getConfig().modal.storage,
  },
  storageKey: {
    type: String as PropType<VxeModalPropTypes.StorageKey>,
    default: () => getConfig().modal.storageKey,
  },
  padding: {
    type: Boolean as PropType<VxeModalPropTypes.Padding>,
    default: () => getConfig().modal.padding,
  },
  size: {
    type: String as PropType<VxeModalPropTypes.Size>,
    default: () => getConfig().modal.size || getConfig().size,
  },
  beforeHideMethod: Function as PropType<VxeModalPropTypes.BeforeHideMethod>,
  slots: Object as PropType<VxeModalPropTypes.Slots>,

  // /**
  //  * 已废弃
  //  * @deprecated
  //  */
  // message: [Number, String] as PropType<VxeModalPropTypes.Message>,
  // /**
  //  * 已废弃
  //  * @deprecated
  //  */
  // animat: {
  //   type: Boolean as PropType<VxeModalPropTypes.Animat>,
  //   default: () => getConfig().modal.animat,
  // },

  //   事件
  onShow: {
    type: Function as PropType<VxeModalEvents.Show>,
    default: noop,
  },

  onHide: {
    type: Function as PropType<VxeModalEvents.Hide>,
    default: noop,
  },

  onBeforeHide: {
    type: Function as PropType<VxeModalEvents.BeforeHide>,
    default: noop,
  },

  onConfirm: {
    type: Function as PropType<VxeModalEvents.Confirm>,
    default: noop,
  },

  onCancel: {
    type: Function as PropType<VxeModalEvents.Cancel>,
    default: noop,
  },
  onClose: {
    type: Function as PropType<VxeModalEvents.Close>,
    default: noop,
  },

  onZoom: {
    type: Function as PropType<VxeModalEvents.Zoom>,
    default: noop,
  },
  onResize: {
    type: Function as PropType<VxeModalEvents.Resize>,
    default: noop,
  },

  onMove: {
    type: Function as PropType<VxeModalEvents.Move>,
    default: noop,
  },
};
